<template>
    <el-menu @select="select" :default-active="defaultActive">
        <el-menu-item index="TransactionAuditList">
            <el-icon>
                <Location />
            </el-icon>
            <span>交易审核中心</span>
        </el-menu-item>
        <el-menu-item index="UserAuditList">
            <el-icon>
                <Location />
            </el-icon>
            <span>企业注册信息审核中心</span>
        </el-menu-item>
        <el-menu-item index="AnnouncementAdd">
            <el-icon>
                <Location />
            </el-icon>
            <span>资讯发布中心</span>
        </el-menu-item>
        <el-menu-item index="AnnouncementVerify">
            <el-icon>
                <Location />
            </el-icon>
            <span>资讯审核中心</span>
        </el-menu-item>
    </el-menu>
</template>

<script lang="ts" setup>
import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
} from '@element-plus/icons-vue'
import { ref, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';

const route = useRoute()
const defaultActive = ref(route.name);
const router = useRouter();
watch(() => route.name, function () {
    defaultActive.value = route.name;
})
const select = (index) => {
    router.push({
        name: index
    })
}

</script>

<style lang="less" scoped>

</style>